Integrand size = 25, antiderivative size = 377 \[ \int \frac {(a+b \sec (e+f x))^2}{(c+d \sec (e+f x))^4} \, dx=\frac {a^2 x}{c^4}-\frac {\left (b^2 c^4 d \left (4 c^2+d^2\right )-a b \left (4 c^7+6 c^5 d^2\right )+a^2 \left (8 c^6 d-8 c^4 d^3+7 c^2 d^5-2 d^7\right )\right ) \text {arctanh}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{c^4 (c-d)^{7/2} (c+d)^{7/2} f}+\frac {d^2 (b+a \cos (e+f x))^2 \sin (e+f x)}{3 c \left (c^2-d^2\right ) f (d+c \cos (e+f x))^3}-\frac {d (b c-a d) \left (6 b c^3-8 a c^2 d-b c d^2+3 a d^3\right ) \sin (e+f x)}{6 c^3 \left (c^2-d^2\right )^2 f (d+c \cos (e+f x))^2}-\frac {\left (2 a b c d \left (18 c^4-5 c^2 d^2+2 d^4\right )-a^2 d^2 \left (34 c^4-28 c^2 d^2+9 d^4\right )-b^2 \left (6 c^6+10 c^4 d^2-c^2 d^4\right )\right ) \sin (e+f x)}{6 c^3 \left (c^2-d^2\right )^3 f (d+c \cos (e+f x))} \]
a^2*x/c^4-(b^2*c^4*d*(4*c^2+d^2)-a*b*(4*c^7+6*c^5*d^2)+a^2*(8*c^6*d-8*c^4* d^3+7*c^2*d^5-2*d^7))*arctanh((c-d)^(1/2)*tan(1/2*f*x+1/2*e)/(c+d)^(1/2))/ c^4/(c-d)^(7/2)/(c+d)^(7/2)/f+1/3*d^2*(b+a*cos(f*x+e))^2*sin(f*x+e)/c/(c^2 -d^2)/f/(d+c*cos(f*x+e))^3-1/6*d*(-a*d+b*c)*(-8*a*c^2*d+3*a*d^3+6*b*c^3-b* c*d^2)*sin(f*x+e)/c^3/(c^2-d^2)^2/f/(d+c*cos(f*x+e))^2-1/6*(2*a*b*c*d*(18* c^4-5*c^2*d^2+2*d^4)-a^2*d^2*(34*c^4-28*c^2*d^2+9*d^4)-b^2*(6*c^6+10*c^4*d ^2-c^2*d^4))*sin(f*x+e)/c^3/(c^2-d^2)^3/f/(d+c*cos(f*x+e))
Time = 4.42 (sec) , antiderivative size = 438, normalized size of antiderivative = 1.16 \[ \int \frac {(a+b \sec (e+f x))^2}{(c+d \sec (e+f x))^4} \, dx=\frac {(d+c \cos (e+f x)) \sec ^2(e+f x) (a+b \sec (e+f x))^2 \left (6 a^2 (e+f x) (d+c \cos (e+f x))^3+\frac {6 \left (b^2 c^4 d \left (4 c^2+d^2\right )-2 a b c^5 \left (2 c^2+3 d^2\right )+a^2 \left (8 c^6 d-8 c^4 d^3+7 c^2 d^5-2 d^7\right )\right ) \text {arctanh}\left (\frac {(-c+d) \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c^2-d^2}}\right ) (d+c \cos (e+f x))^3}{\left (c^2-d^2\right )^{7/2}}+\frac {2 c d^2 (b c-a d)^2 \sin (e+f x)}{c^2-d^2}-\frac {c d \left (a^2 d^2 \left (12 c^2-7 d^2\right )+b^2 \left (6 c^4-c^2 d^2\right )+a b \left (-18 c^3 d+8 c d^3\right )\right ) (d+c \cos (e+f x)) \sin (e+f x)}{\left (c^2-d^2\right )^2}+\frac {c \left (-2 a b c d \left (18 c^4-5 c^2 d^2+2 d^4\right )+a^2 d^2 \left (36 c^4-32 c^2 d^2+11 d^4\right )+b^2 \left (6 c^6+10 c^4 d^2-c^2 d^4\right )\right ) (d+c \cos (e+f x))^2 \sin (e+f x)}{\left (c^2-d^2\right )^3}\right )}{6 c^4 f (b+a \cos (e+f x))^2 (c+d \sec (e+f x))^4} \]
((d + c*Cos[e + f*x])*Sec[e + f*x]^2*(a + b*Sec[e + f*x])^2*(6*a^2*(e + f* x)*(d + c*Cos[e + f*x])^3 + (6*(b^2*c^4*d*(4*c^2 + d^2) - 2*a*b*c^5*(2*c^2 + 3*d^2) + a^2*(8*c^6*d - 8*c^4*d^3 + 7*c^2*d^5 - 2*d^7))*ArcTanh[((-c + d)*Tan[(e + f*x)/2])/Sqrt[c^2 - d^2]]*(d + c*Cos[e + f*x])^3)/(c^2 - d^2)^ (7/2) + (2*c*d^2*(b*c - a*d)^2*Sin[e + f*x])/(c^2 - d^2) - (c*d*(a^2*d^2*( 12*c^2 - 7*d^2) + b^2*(6*c^4 - c^2*d^2) + a*b*(-18*c^3*d + 8*c*d^3))*(d + c*Cos[e + f*x])*Sin[e + f*x])/(c^2 - d^2)^2 + (c*(-2*a*b*c*d*(18*c^4 - 5*c ^2*d^2 + 2*d^4) + a^2*d^2*(36*c^4 - 32*c^2*d^2 + 11*d^4) + b^2*(6*c^6 + 10 *c^4*d^2 - c^2*d^4))*(d + c*Cos[e + f*x])^2*Sin[e + f*x])/(c^2 - d^2)^3))/ (6*c^4*f*(b + a*Cos[e + f*x])^2*(c + d*Sec[e + f*x])^4)
Time = 1.95 (sec) , antiderivative size = 433, normalized size of antiderivative = 1.15, number of steps used = 16, number of rules used = 15, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.600, Rules used = {3042, 4429, 3042, 3527, 25, 3042, 3510, 3042, 3500, 27, 3042, 3214, 3042, 3138, 221}
Below are the steps used by Rubi to obtain the solution. The rule number used for the transformation is given above next to the arrow. The rules definitions used are listed below.
\(\displaystyle \int \frac {(a+b \sec (e+f x))^2}{(c+d \sec (e+f x))^4} \, dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\left (a+b \csc \left (e+f x+\frac {\pi }{2}\right )\right )^2}{\left (c+d \csc \left (e+f x+\frac {\pi }{2}\right )\right )^4}dx\) |
\(\Big \downarrow \) 4429 |
\(\displaystyle \int \frac {\cos ^2(e+f x) (a \cos (e+f x)+b)^2}{(c \cos (e+f x)+d)^4}dx\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \int \frac {\sin \left (e+f x+\frac {\pi }{2}\right )^2 \left (a \sin \left (e+f x+\frac {\pi }{2}\right )+b\right )^2}{\left (c \sin \left (e+f x+\frac {\pi }{2}\right )+d\right )^4}dx\) |
\(\Big \downarrow \) 3527 |
\(\displaystyle \frac {\int -\frac {(b+a \cos (e+f x)) \left (-3 a \left (c^2-d^2\right ) \cos ^2(e+f x)-\left (3 b c^2-3 a d c-b d^2\right ) \cos (e+f x)+d (3 b c-2 a d)\right )}{(d+c \cos (e+f x))^3}dx}{3 c \left (c^2-d^2\right )}+\frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}\) |
\(\Big \downarrow \) 25 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\int \frac {(b+a \cos (e+f x)) \left (-3 a \left (c^2-d^2\right ) \cos ^2(e+f x)+\left (3 a c d-b \left (3 c^2-d^2\right )\right ) \cos (e+f x)+d (3 b c-2 a d)\right )}{(d+c \cos (e+f x))^3}dx}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\int \frac {\left (b+a \sin \left (e+f x+\frac {\pi }{2}\right )\right ) \left (-3 a \left (c^2-d^2\right ) \sin \left (e+f x+\frac {\pi }{2}\right )^2+\left (3 a c d-b \left (3 c^2-d^2\right )\right ) \sin \left (e+f x+\frac {\pi }{2}\right )+d (3 b c-2 a d)\right )}{\left (d+c \sin \left (e+f x+\frac {\pi }{2}\right )\right )^3}dx}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 3510 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\frac {d (b c-a d) \left (-8 a c^2 d+3 a d^3+6 b c^3-b c d^2\right ) \sin (e+f x)}{2 c^2 f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^2}-\frac {\int \frac {6 a^2 c \left (c^2-d^2\right )^2 \cos ^2(e+f x)-\left (\left (3 d^5-10 c^2 d^3+12 c^4 d\right ) a^2-2 b c \left (6 c^4-3 d^2 c^2+2 d^4\right ) a+b^2 c^2 d \left (6 c^2-d^2\right )\right ) \cos (e+f x)+2 c \left (\left (3 c^4+2 d^2 c^2\right ) b^2-2 a c d \left (6 c^2-d^2\right ) b+a^2 d^2 \left (8 c^2-3 d^2\right )\right )}{(d+c \cos (e+f x))^2}dx}{2 c^2 \left (c^2-d^2\right )}}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\frac {d (b c-a d) \left (-8 a c^2 d+3 a d^3+6 b c^3-b c d^2\right ) \sin (e+f x)}{2 c^2 f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^2}-\frac {\int \frac {6 a^2 c \left (c^2-d^2\right )^2 \sin \left (e+f x+\frac {\pi }{2}\right )^2+\left (-\left (\left (3 d^5-10 c^2 d^3+12 c^4 d\right ) a^2\right )+2 b c \left (6 c^4-3 d^2 c^2+2 d^4\right ) a-b^2 c^2 d \left (6 c^2-d^2\right )\right ) \sin \left (e+f x+\frac {\pi }{2}\right )+2 c \left (\left (3 c^4+2 d^2 c^2\right ) b^2-2 a c d \left (6 c^2-d^2\right ) b+a^2 d^2 \left (8 c^2-3 d^2\right )\right )}{\left (d+c \sin \left (e+f x+\frac {\pi }{2}\right )\right )^2}dx}{2 c^2 \left (c^2-d^2\right )}}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 3500 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\frac {d (b c-a d) \left (-8 a c^2 d+3 a d^3+6 b c^3-b c d^2\right ) \sin (e+f x)}{2 c^2 f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^2}-\frac {\frac {\int -\frac {3 \left (c^2 \left (-2 a b \left (2 c^2+3 d^2\right ) c^3+b^2 d \left (4 c^2+d^2\right ) c^2+a^2 \left (d^5-2 c^2 d^3+6 c^4 d\right )\right )-2 a^2 c \left (c^2-d^2\right )^3 \cos (e+f x)\right )}{d+c \cos (e+f x)}dx}{c \left (c^2-d^2\right )}-\frac {\left (-a^2 d^2 \left (34 c^4-28 c^2 d^2+9 d^4\right )+2 a b c d \left (18 c^4-5 c^2 d^2+2 d^4\right )-\left (b^2 \left (6 c^6+10 c^4 d^2-c^2 d^4\right )\right )\right ) \sin (e+f x)}{f \left (c^2-d^2\right ) (c \cos (e+f x)+d)}}{2 c^2 \left (c^2-d^2\right )}}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 27 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\frac {d (b c-a d) \left (-8 a c^2 d+3 a d^3+6 b c^3-b c d^2\right ) \sin (e+f x)}{2 c^2 f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^2}-\frac {-\frac {3 \int \frac {c^2 \left (-2 a b \left (2 c^2+3 d^2\right ) c^3+b^2 d \left (4 c^2+d^2\right ) c^2+a^2 d \left (6 c^4-2 d^2 c^2+d^4\right )\right )-2 a^2 c \left (c^2-d^2\right )^3 \cos (e+f x)}{d+c \cos (e+f x)}dx}{c \left (c^2-d^2\right )}-\frac {\left (-a^2 d^2 \left (34 c^4-28 c^2 d^2+9 d^4\right )+2 a b c d \left (18 c^4-5 c^2 d^2+2 d^4\right )-\left (b^2 \left (6 c^6+10 c^4 d^2-c^2 d^4\right )\right )\right ) \sin (e+f x)}{f \left (c^2-d^2\right ) (c \cos (e+f x)+d)}}{2 c^2 \left (c^2-d^2\right )}}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\frac {d (b c-a d) \left (-8 a c^2 d+3 a d^3+6 b c^3-b c d^2\right ) \sin (e+f x)}{2 c^2 f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^2}-\frac {-\frac {3 \int \frac {c^2 \left (-2 a b \left (2 c^2+3 d^2\right ) c^3+b^2 d \left (4 c^2+d^2\right ) c^2+a^2 d \left (6 c^4-2 d^2 c^2+d^4\right )\right )-2 a^2 c \left (c^2-d^2\right )^3 \sin \left (e+f x+\frac {\pi }{2}\right )}{d+c \sin \left (e+f x+\frac {\pi }{2}\right )}dx}{c \left (c^2-d^2\right )}-\frac {\left (-a^2 d^2 \left (34 c^4-28 c^2 d^2+9 d^4\right )+2 a b c d \left (18 c^4-5 c^2 d^2+2 d^4\right )-\left (b^2 \left (6 c^6+10 c^4 d^2-c^2 d^4\right )\right )\right ) \sin (e+f x)}{f \left (c^2-d^2\right ) (c \cos (e+f x)+d)}}{2 c^2 \left (c^2-d^2\right )}}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 3214 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\frac {d (b c-a d) \left (-8 a c^2 d+3 a d^3+6 b c^3-b c d^2\right ) \sin (e+f x)}{2 c^2 f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^2}-\frac {-\frac {3 \left (\left (a^2 \left (8 c^6 d-8 c^4 d^3+7 c^2 d^5-2 d^7\right )-2 a b c^5 \left (2 c^2+3 d^2\right )+b^2 c^4 d \left (4 c^2+d^2\right )\right ) \int \frac {1}{d+c \cos (e+f x)}dx-2 a^2 x \left (c^2-d^2\right )^3\right )}{c \left (c^2-d^2\right )}-\frac {\left (-a^2 d^2 \left (34 c^4-28 c^2 d^2+9 d^4\right )+2 a b c d \left (18 c^4-5 c^2 d^2+2 d^4\right )-\left (b^2 \left (6 c^6+10 c^4 d^2-c^2 d^4\right )\right )\right ) \sin (e+f x)}{f \left (c^2-d^2\right ) (c \cos (e+f x)+d)}}{2 c^2 \left (c^2-d^2\right )}}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 3042 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\frac {d (b c-a d) \left (-8 a c^2 d+3 a d^3+6 b c^3-b c d^2\right ) \sin (e+f x)}{2 c^2 f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^2}-\frac {-\frac {3 \left (\left (a^2 \left (8 c^6 d-8 c^4 d^3+7 c^2 d^5-2 d^7\right )-2 a b c^5 \left (2 c^2+3 d^2\right )+b^2 c^4 d \left (4 c^2+d^2\right )\right ) \int \frac {1}{d+c \sin \left (e+f x+\frac {\pi }{2}\right )}dx-2 a^2 x \left (c^2-d^2\right )^3\right )}{c \left (c^2-d^2\right )}-\frac {\left (-a^2 d^2 \left (34 c^4-28 c^2 d^2+9 d^4\right )+2 a b c d \left (18 c^4-5 c^2 d^2+2 d^4\right )-\left (b^2 \left (6 c^6+10 c^4 d^2-c^2 d^4\right )\right )\right ) \sin (e+f x)}{f \left (c^2-d^2\right ) (c \cos (e+f x)+d)}}{2 c^2 \left (c^2-d^2\right )}}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 3138 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\frac {d (b c-a d) \left (-8 a c^2 d+3 a d^3+6 b c^3-b c d^2\right ) \sin (e+f x)}{2 c^2 f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^2}-\frac {-\frac {3 \left (\frac {2 \left (a^2 \left (8 c^6 d-8 c^4 d^3+7 c^2 d^5-2 d^7\right )-2 a b c^5 \left (2 c^2+3 d^2\right )+b^2 c^4 d \left (4 c^2+d^2\right )\right ) \int \frac {1}{-\left ((c-d) \tan ^2\left (\frac {1}{2} (e+f x)\right )\right )+c+d}d\tan \left (\frac {1}{2} (e+f x)\right )}{f}-2 a^2 x \left (c^2-d^2\right )^3\right )}{c \left (c^2-d^2\right )}-\frac {\left (-a^2 d^2 \left (34 c^4-28 c^2 d^2+9 d^4\right )+2 a b c d \left (18 c^4-5 c^2 d^2+2 d^4\right )-\left (b^2 \left (6 c^6+10 c^4 d^2-c^2 d^4\right )\right )\right ) \sin (e+f x)}{f \left (c^2-d^2\right ) (c \cos (e+f x)+d)}}{2 c^2 \left (c^2-d^2\right )}}{3 c \left (c^2-d^2\right )}\) |
\(\Big \downarrow \) 221 |
\(\displaystyle \frac {d^2 \sin (e+f x) (a \cos (e+f x)+b)^2}{3 c f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^3}-\frac {\frac {d (b c-a d) \left (-8 a c^2 d+3 a d^3+6 b c^3-b c d^2\right ) \sin (e+f x)}{2 c^2 f \left (c^2-d^2\right ) (c \cos (e+f x)+d)^2}-\frac {-\frac {3 \left (\frac {2 \left (a^2 \left (8 c^6 d-8 c^4 d^3+7 c^2 d^5-2 d^7\right )-2 a b c^5 \left (2 c^2+3 d^2\right )+b^2 c^4 d \left (4 c^2+d^2\right )\right ) \text {arctanh}\left (\frac {\sqrt {c-d} \tan \left (\frac {1}{2} (e+f x)\right )}{\sqrt {c+d}}\right )}{f \sqrt {c-d} \sqrt {c+d}}-2 a^2 x \left (c^2-d^2\right )^3\right )}{c \left (c^2-d^2\right )}-\frac {\left (-a^2 d^2 \left (34 c^4-28 c^2 d^2+9 d^4\right )+2 a b c d \left (18 c^4-5 c^2 d^2+2 d^4\right )-\left (b^2 \left (6 c^6+10 c^4 d^2-c^2 d^4\right )\right )\right ) \sin (e+f x)}{f \left (c^2-d^2\right ) (c \cos (e+f x)+d)}}{2 c^2 \left (c^2-d^2\right )}}{3 c \left (c^2-d^2\right )}\) |
(d^2*(b + a*Cos[e + f*x])^2*Sin[e + f*x])/(3*c*(c^2 - d^2)*f*(d + c*Cos[e + f*x])^3) - ((d*(b*c - a*d)*(6*b*c^3 - 8*a*c^2*d - b*c*d^2 + 3*a*d^3)*Sin [e + f*x])/(2*c^2*(c^2 - d^2)*f*(d + c*Cos[e + f*x])^2) - ((-3*(-2*a^2*(c^ 2 - d^2)^3*x + (2*(b^2*c^4*d*(4*c^2 + d^2) - 2*a*b*c^5*(2*c^2 + 3*d^2) + a ^2*(8*c^6*d - 8*c^4*d^3 + 7*c^2*d^5 - 2*d^7))*ArcTanh[(Sqrt[c - d]*Tan[(e + f*x)/2])/Sqrt[c + d]])/(Sqrt[c - d]*Sqrt[c + d]*f)))/(c*(c^2 - d^2)) - ( (2*a*b*c*d*(18*c^4 - 5*c^2*d^2 + 2*d^4) - a^2*d^2*(34*c^4 - 28*c^2*d^2 + 9 *d^4) - b^2*(6*c^6 + 10*c^4*d^2 - c^2*d^4))*Sin[e + f*x])/((c^2 - d^2)*f*( d + c*Cos[e + f*x])))/(2*c^2*(c^2 - d^2)))/(3*c*(c^2 - d^2))
3.2.94.3.1 Defintions of rubi rules used
Int[(a_)*(Fx_), x_Symbol] :> Simp[a Int[Fx, x], x] /; FreeQ[a, x] && !Ma tchQ[Fx, (b_)*(Gx_) /; FreeQ[b, x]]
Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(Rt[-a/b, 2]/a)*ArcTanh[x /Rt[-a/b, 2]], x] /; FreeQ[{a, b}, x] && NegQ[a/b]
Int[((a_) + (b_.)*sin[Pi/2 + (c_.) + (d_.)*(x_)])^(-1), x_Symbol] :> With[{ e = FreeFactors[Tan[(c + d*x)/2], x]}, Simp[2*(e/d) Subst[Int[1/(a + b + (a - b)*e^2*x^2), x], x, Tan[(c + d*x)/2]/e], x]] /; FreeQ[{a, b, c, d}, x] && NeQ[a^2 - b^2, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])/((c_.) + (d_.)*sin[(e_.) + (f_. )*(x_)]), x_Symbol] :> Simp[b*(x/d), x] - Simp[(b*c - a*d)/d Int[1/(c + d *Sin[e + f*x]), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(A*b^2 - a*b*B + a^2*C))*Cos[e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b*f*(m + 1)* (a^2 - b^2))), x] + Simp[1/(b*(m + 1)*(a^2 - b^2)) Int[(a + b*Sin[e + f*x ])^(m + 1)*Simp[b*(a*A - b*B + a*C)*(m + 1) - (A*b^2 - a*b*B + a^2*C + b*(A *b - a*B + b*C)*(m + 1))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, e, f, A, B, C}, x] && LtQ[m, -1] && NeQ[a^2 - b^2, 0]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])*((A_.) + (B_.)*sin[(e_.) + (f_.)*(x_)] + (C_.)*sin[(e_.) + (f _.)*(x_)]^2), x_Symbol] :> Simp[(-(b*c - a*d))*(A*b^2 - a*b*B + a^2*C)*Cos[ e + f*x]*((a + b*Sin[e + f*x])^(m + 1)/(b^2*f*(m + 1)*(a^2 - b^2))), x] - S imp[1/(b^2*(m + 1)*(a^2 - b^2)) Int[(a + b*Sin[e + f*x])^(m + 1)*Simp[b*( m + 1)*((b*B - a*C)*(b*c - a*d) - A*b*(a*c - b*d)) + (b*B*(a^2*d + b^2*d*(m + 1) - a*b*c*(m + 2)) + (b*c - a*d)*(A*b^2*(m + 2) + C*(a^2 + b^2*(m + 1)) ))*Sin[e + f*x] - b*C*d*(m + 1)*(a^2 - b^2)*Sin[e + f*x]^2, x], x], x] /; F reeQ[{a, b, c, d, e, f, A, B, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && LtQ[m, -1]
Int[((a_.) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)])^(n_)*((A_.) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-(c^2*C + A*d^2))*Cos[e + f*x]*(a + b*Sin[e + f*x])^m*((c + d*Sin[e + f*x])^(n + 1)/(d*f*(n + 1)*(c^2 - d^2))), x] + Simp[1/(d*(n + 1)*(c^2 - d^ 2)) Int[(a + b*Sin[e + f*x])^(m - 1)*(c + d*Sin[e + f*x])^(n + 1)*Simp[A* d*(b*d*m + a*c*(n + 1)) + c*C*(b*c*m + a*d*(n + 1)) - (A*d*(a*d*(n + 2) - b *c*(n + 1)) - C*(b*c*d*(n + 1) - a*(c^2 + d^2*(n + 1))))*Sin[e + f*x] - b*( A*d^2*(m + n + 2) + C*(c^2*(m + 1) + d^2*(n + 1)))*Sin[e + f*x]^2, x], x], x] /; FreeQ[{a, b, c, d, e, f, A, C}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 - b^2, 0] && NeQ[c^2 - d^2, 0] && GtQ[m, 0] && LtQ[n, -1]
Int[(csc[(e_.) + (f_.)*(x_)]*(b_.) + (a_))^(m_)*(csc[(e_.) + (f_.)*(x_)]*(d _.) + (c_))^(n_), x_Symbol] :> Int[(b + a*Sin[e + f*x])^m*((d + c*Sin[e + f *x])^n/Sin[e + f*x]^(m + n)), x] /; FreeQ[{a, b, c, d, e, f, m, n}, x] && N eQ[b*c - a*d, 0] && IntegerQ[m] && IntegerQ[n] && LeQ[-2, m + n, 0]
Time = 1.10 (sec) , antiderivative size = 635, normalized size of antiderivative = 1.68
method | result | size |
derivativedivides | \(\frac {\frac {2 a^{2} \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c^{4}}+\frac {\frac {2 \left (-\frac {\left (12 a^{2} c^{4} d^{2}+4 a^{2} c^{3} d^{3}-6 a^{2} d^{4} c^{2}-a^{2} c \,d^{5}+2 a^{2} d^{6}-12 d a b \,c^{5}-6 a b \,c^{4} d^{2}-4 a b \,d^{3} c^{3}+2 b^{2} c^{6}+2 b^{2} c^{5} d +6 b^{2} c^{4} d^{2}+b^{2} c^{3} d^{3}\right ) c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{2 \left (c -d \right ) \left (c^{3}+3 c^{2} d +3 c \,d^{2}+d^{3}\right )}+\frac {2 \left (18 a^{2} c^{4} d^{2}-11 a^{2} d^{4} c^{2}+3 a^{2} d^{6}-18 d a b \,c^{5}-2 a b \,d^{3} c^{3}+3 b^{2} c^{6}+7 b^{2} c^{4} d^{2}\right ) c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 \left (c^{2}-2 c d +d^{2}\right ) \left (c^{2}+2 c d +d^{2}\right )}-\frac {\left (12 a^{2} c^{4} d^{2}-4 a^{2} c^{3} d^{3}-6 a^{2} d^{4} c^{2}+a^{2} c \,d^{5}+2 a^{2} d^{6}-12 d a b \,c^{5}+6 a b \,c^{4} d^{2}-4 a b \,d^{3} c^{3}+2 b^{2} c^{6}-2 b^{2} c^{5} d +6 b^{2} c^{4} d^{2}-b^{2} c^{3} d^{3}\right ) c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 \left (c +d \right ) \left (c^{3}-3 c^{2} d +3 c \,d^{2}-d^{3}\right )}\right )}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} c -\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )^{3}}-\frac {\left (8 a^{2} c^{6} d -8 a^{2} c^{4} d^{3}+7 a^{2} c^{2} d^{5}-2 a^{2} d^{7}-4 a b \,c^{7}-6 a b \,c^{5} d^{2}+4 b^{2} c^{6} d +b^{2} c^{4} d^{3}\right ) \operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{\left (c^{6}-3 c^{4} d^{2}+3 c^{2} d^{4}-d^{6}\right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}}{c^{4}}}{f}\) | \(635\) |
default | \(\frac {\frac {2 a^{2} \arctan \left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )\right )}{c^{4}}+\frac {\frac {2 \left (-\frac {\left (12 a^{2} c^{4} d^{2}+4 a^{2} c^{3} d^{3}-6 a^{2} d^{4} c^{2}-a^{2} c \,d^{5}+2 a^{2} d^{6}-12 d a b \,c^{5}-6 a b \,c^{4} d^{2}-4 a b \,d^{3} c^{3}+2 b^{2} c^{6}+2 b^{2} c^{5} d +6 b^{2} c^{4} d^{2}+b^{2} c^{3} d^{3}\right ) c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{5}}{2 \left (c -d \right ) \left (c^{3}+3 c^{2} d +3 c \,d^{2}+d^{3}\right )}+\frac {2 \left (18 a^{2} c^{4} d^{2}-11 a^{2} d^{4} c^{2}+3 a^{2} d^{6}-18 d a b \,c^{5}-2 a b \,d^{3} c^{3}+3 b^{2} c^{6}+7 b^{2} c^{4} d^{2}\right ) c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{3}}{3 \left (c^{2}-2 c d +d^{2}\right ) \left (c^{2}+2 c d +d^{2}\right )}-\frac {\left (12 a^{2} c^{4} d^{2}-4 a^{2} c^{3} d^{3}-6 a^{2} d^{4} c^{2}+a^{2} c \,d^{5}+2 a^{2} d^{6}-12 d a b \,c^{5}+6 a b \,c^{4} d^{2}-4 a b \,d^{3} c^{3}+2 b^{2} c^{6}-2 b^{2} c^{5} d +6 b^{2} c^{4} d^{2}-b^{2} c^{3} d^{3}\right ) c \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{2 \left (c +d \right ) \left (c^{3}-3 c^{2} d +3 c \,d^{2}-d^{3}\right )}\right )}{\left (\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} c -\tan \left (\frac {f x}{2}+\frac {e}{2}\right )^{2} d -c -d \right )^{3}}-\frac {\left (8 a^{2} c^{6} d -8 a^{2} c^{4} d^{3}+7 a^{2} c^{2} d^{5}-2 a^{2} d^{7}-4 a b \,c^{7}-6 a b \,c^{5} d^{2}+4 b^{2} c^{6} d +b^{2} c^{4} d^{3}\right ) \operatorname {arctanh}\left (\frac {\left (c -d \right ) \tan \left (\frac {f x}{2}+\frac {e}{2}\right )}{\sqrt {\left (c +d \right ) \left (c -d \right )}}\right )}{\left (c^{6}-3 c^{4} d^{2}+3 c^{2} d^{4}-d^{6}\right ) \sqrt {\left (c +d \right ) \left (c -d \right )}}}{c^{4}}}{f}\) | \(635\) |
risch | \(\text {Expression too large to display}\) | \(2555\) |
1/f*(2*a^2/c^4*arctan(tan(1/2*f*x+1/2*e))+2/c^4*((-1/2*(12*a^2*c^4*d^2+4*a ^2*c^3*d^3-6*a^2*c^2*d^4-a^2*c*d^5+2*a^2*d^6-12*a*b*c^5*d-6*a*b*c^4*d^2-4* a*b*c^3*d^3+2*b^2*c^6+2*b^2*c^5*d+6*b^2*c^4*d^2+b^2*c^3*d^3)*c/(c-d)/(c^3+ 3*c^2*d+3*c*d^2+d^3)*tan(1/2*f*x+1/2*e)^5+2/3*(18*a^2*c^4*d^2-11*a^2*c^2*d ^4+3*a^2*d^6-18*a*b*c^5*d-2*a*b*c^3*d^3+3*b^2*c^6+7*b^2*c^4*d^2)*c/(c^2-2* c*d+d^2)/(c^2+2*c*d+d^2)*tan(1/2*f*x+1/2*e)^3-1/2*(12*a^2*c^4*d^2-4*a^2*c^ 3*d^3-6*a^2*c^2*d^4+a^2*c*d^5+2*a^2*d^6-12*a*b*c^5*d+6*a*b*c^4*d^2-4*a*b*c ^3*d^3+2*b^2*c^6-2*b^2*c^5*d+6*b^2*c^4*d^2-b^2*c^3*d^3)*c/(c+d)/(c^3-3*c^2 *d+3*c*d^2-d^3)*tan(1/2*f*x+1/2*e))/(tan(1/2*f*x+1/2*e)^2*c-tan(1/2*f*x+1/ 2*e)^2*d-c-d)^3-1/2*(8*a^2*c^6*d-8*a^2*c^4*d^3+7*a^2*c^2*d^5-2*a^2*d^7-4*a *b*c^7-6*a*b*c^5*d^2+4*b^2*c^6*d+b^2*c^4*d^3)/(c^6-3*c^4*d^2+3*c^2*d^4-d^6 )/((c+d)*(c-d))^(1/2)*arctanh((c-d)*tan(1/2*f*x+1/2*e)/((c+d)*(c-d))^(1/2) )))
Leaf count of result is larger than twice the leaf count of optimal. 1152 vs. \(2 (362) = 724\).
Time = 0.45 (sec) , antiderivative size = 2362, normalized size of antiderivative = 6.27 \[ \int \frac {(a+b \sec (e+f x))^2}{(c+d \sec (e+f x))^4} \, dx=\text {Too large to display} \]
[1/12*(12*(a^2*c^11 - 4*a^2*c^9*d^2 + 6*a^2*c^7*d^4 - 4*a^2*c^5*d^6 + a^2* c^3*d^8)*f*x*cos(f*x + e)^3 + 36*(a^2*c^10*d - 4*a^2*c^8*d^3 + 6*a^2*c^6*d ^5 - 4*a^2*c^4*d^7 + a^2*c^2*d^9)*f*x*cos(f*x + e)^2 + 36*(a^2*c^9*d^2 - 4 *a^2*c^7*d^4 + 6*a^2*c^5*d^6 - 4*a^2*c^3*d^8 + a^2*c*d^10)*f*x*cos(f*x + e ) + 12*(a^2*c^8*d^3 - 4*a^2*c^6*d^5 + 6*a^2*c^4*d^7 - 4*a^2*c^2*d^9 + a^2* d^11)*f*x - 3*(4*a*b*c^7*d^3 + 6*a*b*c^5*d^5 - 7*a^2*c^2*d^8 + 2*a^2*d^10 - 4*(2*a^2 + b^2)*c^6*d^4 + (8*a^2 - b^2)*c^4*d^6 + (4*a*b*c^10 + 6*a*b*c^ 8*d^2 - 7*a^2*c^5*d^5 + 2*a^2*c^3*d^7 - 4*(2*a^2 + b^2)*c^9*d + (8*a^2 - b ^2)*c^7*d^3)*cos(f*x + e)^3 + 3*(4*a*b*c^9*d + 6*a*b*c^7*d^3 - 7*a^2*c^4*d ^6 + 2*a^2*c^2*d^8 - 4*(2*a^2 + b^2)*c^8*d^2 + (8*a^2 - b^2)*c^6*d^4)*cos( f*x + e)^2 + 3*(4*a*b*c^8*d^2 + 6*a*b*c^6*d^4 - 7*a^2*c^3*d^7 + 2*a^2*c*d^ 9 - 4*(2*a^2 + b^2)*c^7*d^3 + (8*a^2 - b^2)*c^5*d^5)*cos(f*x + e))*sqrt(c^ 2 - d^2)*log((2*c*d*cos(f*x + e) - (c^2 - 2*d^2)*cos(f*x + e)^2 - 2*sqrt(c ^2 - d^2)*(d*cos(f*x + e) + c)*sin(f*x + e) + 2*c^2 - d^2)/(c^2*cos(f*x + e)^2 + 2*c*d*cos(f*x + e) + d^2)) + 2*(2*b^2*c^9*d^2 - 22*a*b*c^8*d^3 + 14 *a*b*c^6*d^5 + 8*a*b*c^4*d^7 + 23*a^2*c^3*d^8 - 6*a^2*c*d^10 + (26*a^2 + 1 1*b^2)*c^7*d^4 - (43*a^2 + 13*b^2)*c^5*d^6 + (6*b^2*c^11 - 36*a*b*c^10*d + 46*a*b*c^8*d^3 - 14*a*b*c^6*d^5 + 4*a*b*c^4*d^7 - 11*a^2*c^3*d^8 + 4*(9*a ^2 + b^2)*c^9*d^2 - (68*a^2 + 11*b^2)*c^7*d^4 + (43*a^2 + b^2)*c^5*d^6)*co s(f*x + e)^2 + 3*(2*b^2*c^10*d - 18*a*b*c^9*d^2 + 16*a*b*c^7*d^4 + 2*a*...
\[ \int \frac {(a+b \sec (e+f x))^2}{(c+d \sec (e+f x))^4} \, dx=\int \frac {\left (a + b \sec {\left (e + f x \right )}\right )^{2}}{\left (c + d \sec {\left (e + f x \right )}\right )^{4}}\, dx \]
Exception generated. \[ \int \frac {(a+b \sec (e+f x))^2}{(c+d \sec (e+f x))^4} \, dx=\text {Exception raised: ValueError} \]
Exception raised: ValueError >> Computation failed since Maxima requested additional constraints; using the 'assume' command before evaluation *may* help (example of legal syntax is 'assume(4*c^2-4*d^2>0)', see `assume?` f or more de
Leaf count of result is larger than twice the leaf count of optimal. 1201 vs. \(2 (362) = 724\).
Time = 0.40 (sec) , antiderivative size = 1201, normalized size of antiderivative = 3.19 \[ \int \frac {(a+b \sec (e+f x))^2}{(c+d \sec (e+f x))^4} \, dx=\text {Too large to display} \]
1/3*(3*(4*a*b*c^7 - 8*a^2*c^6*d - 4*b^2*c^6*d + 6*a*b*c^5*d^2 + 8*a^2*c^4* d^3 - b^2*c^4*d^3 - 7*a^2*c^2*d^5 + 2*a^2*d^7)*(pi*floor(1/2*(f*x + e)/pi + 1/2)*sgn(-2*c + 2*d) + arctan(-(c*tan(1/2*f*x + 1/2*e) - d*tan(1/2*f*x + 1/2*e))/sqrt(-c^2 + d^2)))/((c^10 - 3*c^8*d^2 + 3*c^6*d^4 - c^4*d^6)*sqrt (-c^2 + d^2)) + 3*(f*x + e)*a^2/c^4 - (6*b^2*c^8*tan(1/2*f*x + 1/2*e)^5 - 36*a*b*c^7*d*tan(1/2*f*x + 1/2*e)^5 - 6*b^2*c^7*d*tan(1/2*f*x + 1/2*e)^5 + 36*a^2*c^6*d^2*tan(1/2*f*x + 1/2*e)^5 + 54*a*b*c^6*d^2*tan(1/2*f*x + 1/2* e)^5 + 12*b^2*c^6*d^2*tan(1/2*f*x + 1/2*e)^5 - 60*a^2*c^5*d^3*tan(1/2*f*x + 1/2*e)^5 - 12*a*b*c^5*d^3*tan(1/2*f*x + 1/2*e)^5 - 27*b^2*c^5*d^3*tan(1/ 2*f*x + 1/2*e)^5 - 6*a^2*c^4*d^4*tan(1/2*f*x + 1/2*e)^5 + 6*a*b*c^4*d^4*ta n(1/2*f*x + 1/2*e)^5 + 12*b^2*c^4*d^4*tan(1/2*f*x + 1/2*e)^5 + 45*a^2*c^3* d^5*tan(1/2*f*x + 1/2*e)^5 - 12*a*b*c^3*d^5*tan(1/2*f*x + 1/2*e)^5 + 3*b^2 *c^3*d^5*tan(1/2*f*x + 1/2*e)^5 - 6*a^2*c^2*d^6*tan(1/2*f*x + 1/2*e)^5 - 1 5*a^2*c*d^7*tan(1/2*f*x + 1/2*e)^5 + 6*a^2*d^8*tan(1/2*f*x + 1/2*e)^5 - 12 *b^2*c^8*tan(1/2*f*x + 1/2*e)^3 + 72*a*b*c^7*d*tan(1/2*f*x + 1/2*e)^3 - 72 *a^2*c^6*d^2*tan(1/2*f*x + 1/2*e)^3 - 16*b^2*c^6*d^2*tan(1/2*f*x + 1/2*e)^ 3 - 64*a*b*c^5*d^3*tan(1/2*f*x + 1/2*e)^3 + 116*a^2*c^4*d^4*tan(1/2*f*x + 1/2*e)^3 + 28*b^2*c^4*d^4*tan(1/2*f*x + 1/2*e)^3 - 8*a*b*c^3*d^5*tan(1/2*f *x + 1/2*e)^3 - 56*a^2*c^2*d^6*tan(1/2*f*x + 1/2*e)^3 + 12*a^2*d^8*tan(1/2 *f*x + 1/2*e)^3 + 6*b^2*c^8*tan(1/2*f*x + 1/2*e) - 36*a*b*c^7*d*tan(1/2...
Time = 27.00 (sec) , antiderivative size = 12818, normalized size of antiderivative = 34.00 \[ \int \frac {(a+b \sec (e+f x))^2}{(c+d \sec (e+f x))^4} \, dx=\text {Too large to display} \]
(2*a^2*atan(((a^2*((8*tan(e/2 + (f*x)/2)*(4*a^4*c^14 + 8*a^4*d^14 - 8*a^4* c*d^13 - 8*a^4*c^13*d + 16*a^2*b^2*c^14 - 48*a^4*c^2*d^12 + 48*a^4*c^3*d^1 1 + 117*a^4*c^4*d^10 - 120*a^4*c^5*d^9 - 164*a^4*c^6*d^8 + 160*a^4*c^7*d^7 + 156*a^4*c^8*d^6 - 120*a^4*c^9*d^5 - 92*a^4*c^10*d^4 + 48*a^4*c^11*d^3 + 44*a^4*c^12*d^2 + b^4*c^8*d^6 + 8*b^4*c^10*d^4 + 16*b^4*c^12*d^2 - 12*a*b ^3*c^9*d^5 - 56*a*b^3*c^11*d^3 + 24*a^3*b*c^5*d^9 - 68*a^3*b*c^7*d^7 + 40* a^3*b*c^9*d^5 - 32*a^3*b*c^11*d^3 - 4*a^2*b^2*c^4*d^10 - 2*a^2*b^2*c^6*d^8 + 40*a^2*b^2*c^8*d^6 - 12*a^2*b^2*c^10*d^4 + 112*a^2*b^2*c^12*d^2 - 32*a* b^3*c^13*d - 64*a^3*b*c^13*d))/(c^16*d + c^17 - c^6*d^11 - c^7*d^10 + 5*c^ 8*d^9 + 5*c^9*d^8 - 10*c^10*d^7 - 10*c^11*d^6 + 10*c^12*d^5 + 10*c^13*d^4 - 5*c^14*d^3 - 5*c^15*d^2) + (a^2*((8*(4*a^2*c^21 - 16*a^2*c^20*d - 8*b^2* c^20*d - 4*a^2*c^8*d^13 + 2*a^2*c^9*d^12 + 26*a^2*c^10*d^11 - 14*a^2*c^11* d^10 - 70*a^2*c^12*d^9 + 30*a^2*c^13*d^8 + 110*a^2*c^14*d^7 - 30*a^2*c^15* d^6 - 110*a^2*c^16*d^5 + 20*a^2*c^17*d^4 + 64*a^2*c^18*d^3 - 12*a^2*c^19*d ^2 - 2*b^2*c^11*d^10 + 2*b^2*c^12*d^9 - 2*b^2*c^13*d^8 + 2*b^2*c^14*d^7 + 18*b^2*c^15*d^6 - 18*b^2*c^16*d^5 - 22*b^2*c^17*d^4 + 22*b^2*c^18*d^3 + 8* b^2*c^19*d^2 + 8*a*b*c^21 - 8*a*b*c^20*d + 12*a*b*c^12*d^9 - 12*a*b*c^13*d ^8 - 28*a*b*c^14*d^7 + 28*a*b*c^15*d^6 + 12*a*b*c^16*d^5 - 12*a*b*c^17*d^4 + 12*a*b*c^18*d^3 - 12*a*b*c^19*d^2))/(c^19*d + c^20 - c^9*d^11 - c^10*d^ 10 + 5*c^11*d^9 + 5*c^12*d^8 - 10*c^13*d^7 - 10*c^14*d^6 + 10*c^15*d^5 ...